//
//  MainDiscernTbvCellPic.m
//  ZITHER
//
//  Created by weixin on 2018/11/27.
//  Copyright © 2018 weixn. All rights reserved.
//

#import "MainDiscernTbvCellPic.h"

@implementation MainDiscernTbvCellPic

- (void)awakeFromNib {
    
    [super awakeFromNib];
    
    self.viewBorder.backgroundColor = [UIColor colorWithHex:@"F5F5F5"];
    [self.viewBorder setCornerRadiusWithRadius:10 isMasks:YES];
    [self.viewBorder mas_updateConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self).offset(20);
        make.bottom.equalTo(self).offset(-40);
        make.left.equalTo(self).offset(32);
        make.right.equalTo(self).offset(-32);
    }];
    
    [self setUI];
    
    [self masonry];
}

-(void)setUI{
    [self addSubview:self.leftPic];
    [self addSubview:self.leftTitle];
    [self addSubview:self.RightPic];
    [self addSubview:self.RightTitle];
    [self addSubview:self.lineV];
    [self addSubview:self.LineSelectV];
}

-(void)masonry{
    
    [self.leftPic mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mas_top).offset(30);
        make.right.equalTo(self.mas_centerX).offset(-70);
        make.height.width.mas_equalTo(40);
    }];
    
    [self.leftTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.leftPic.mas_bottom).offset(10);
        make.centerX.equalTo(self.leftPic.mas_centerX).offset(0);
        make.bottom.equalTo(self.mas_bottom).offset(-46);
    }];

    [self.RightPic mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mas_top).offset(30);
        make.left.equalTo(self.mas_centerX).offset(70);
        make.height.width.mas_equalTo(40);
    }];

    [self.RightTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.RightPic.mas_bottom).offset(10);
        make.centerX.equalTo(self.RightPic.mas_centerX).offset(0);
    }];

    [self.lineV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.leftPic.mas_centerY).offset(0);
        make.left.equalTo(self.leftPic.mas_right).offset(0);
        make.right.equalTo(self.RightPic.mas_left).offset(0);
        make.height.mas_equalTo(2);
    }];
    [self.LineSelectV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.leftPic.mas_centerY).offset(0);
        make.left.equalTo(self.leftPic.mas_right).offset(0);
        make.width.mas_equalTo(70);
        make.height.mas_equalTo(2);
    }];
  

}

- (BaseImageV *)leftPic{
    if (!_leftPic) {
        _leftPic = [[BaseImageV alloc]initializeFrame:CGRectMake(0, 0, 0, 0) contentMode:2];
        _leftPic.image = [UIImage imageNamed:@"我要认证_拍视频"];
        _leftPic.backgroundColor = [UIColor clearColor];
    }
    return _leftPic;
}

- (BaseImageV *)RightPic{
    if (!_RightPic) {
        _RightPic = [[BaseImageV alloc]initializeFrame:CGRectMake(0, 0, 0, 0) contentMode:2];
        _RightPic.image = [UIImage imageNamed:@"我要认证_选择表款"];
        _RightPic.backgroundColor = [UIColor clearColor];
    }
    return _RightPic;
}

-(BaseLab *)leftTitle{
    if (!_leftTitle) {
        _leftTitle = [[BaseLab alloc]initializeFrame:CGRectMake(0, 0, 0, 0) text:@"拍视频" font:12 textColor:[UIColor blackColor] isBold:NO numberOfLines:1];
    }
    return _leftTitle;
}

-(BaseLab *)RightTitle{
    if (!_RightTitle) {
        _RightTitle = [[BaseLab alloc]initializeFrame:CGRectMake(0, 0, 0, 0) text:@"选择表款" font:12 textColor:[UIColor blackColor] isBold:NO numberOfLines:1];
    }
    return _RightTitle;
}

-(BaseView *)lineV{
    if (!_lineV) {
        _lineV = [[BaseView alloc]initWithFrame:CGRectMake(0, 0, 0, 0)];
        _lineV.backgroundColor = [UIColor RGBColorWithR:216 g:216 b:216];
    }
    return _lineV;
}

-(BaseView *)LineSelectV{
    if (!_LineSelectV) {
        _LineSelectV = [[BaseView alloc]initWithFrame:CGRectMake(0, 0, 0, 0)];
        _LineSelectV.backgroundColor = baseColorTheme;
    }
    return _LineSelectV;
}

-(void)setStare:(type)stare{
    switch (stare) {
        case defaul:{
            [self.LineSelectV mas_makeConstraints:^(MASConstraintMaker *make) {
                make.centerY.equalTo(self.leftPic.mas_centerY).offset(0);
                make.left.equalTo(self.leftPic.mas_right).offset(0);
                make.width.mas_equalTo(70);
                make.height.mas_equalTo(2);
            }];
            self.RightPic.image = [UIImage imageNamed:@"我要认证_选择表款"];

        }
            break;
        case selectWatch:{
            [self.LineSelectV mas_updateConstraints:^(MASConstraintMaker *make) {
                make.centerY.equalTo(self.leftPic.mas_centerY).offset(0);
                make.left.equalTo(self.leftPic.mas_right).offset(0);
                make.right.equalTo(self.RightPic.mas_left).offset(0);
                make.height.mas_equalTo(2);
            }];
            self.RightPic.image = [UIImage imageNamed:@"选择表款_选择"];

        }
            break;
        default:
            break;
    }


}

@end
